import React, { useState, useEffect } from 'react';

import { NavBar, Icon } from 'antd-mobile';


import './helpDetails.scss';

import { GetParentKnowHtml } from "@/api/login.js"; // login api
import {learningMaterials} from "@/api/tutor/evaluation"
import {R} from "@/assets/js/dict"

function MaterialsDetails (props) {
    let [knowHtml, setKnowHtml] = useState("");

    useEffect(() => {
        learningMaterials(res => {
           if(R.isSuccess(res)){
               setKnowHtml(R.getData(res));
           }
        })
    }, []);


    return (
        <div className="helpDetails">
            <div className="page-title helpDetails-tit">
                <NavBar
                    mode="light"
                    icon={<Icon type="left" />}
                    onLeftClick={() => {
                        props.history.goBack()
                    }}
                >
                    学习资料
                </NavBar>
            </div>
            <div className="page-content helpDetails-con" dangerouslySetInnerHTML={{ __html: knowHtml }}>

            </div>
        </div>
    );
}

export default MaterialsDetails;